package com.starbugs.wehcat.aop;

public class CalcImpl implements Calc {

  public static void main(String[] args) {
    Calc calcImpl = new CalcImpl();
    Calc proxy = new JDKProxy(calcImpl).createProxy();
    proxy.add(1, 2);

    CalcDao calcDao = new CalcDao();
    CalcDao proxy1 = new CgLibProxy(calcDao).createProxy();
    proxy1.save();
  }

  @Override
  public int add(int i, int j) {
    System.out.println("this is add !!!");
    int result = i + j;
    return result;
  }

  @Override
  public int sub(int i, int j) {
    int result = i - j;
    return result;
  }

  @Override
  public int mul(int i, int j) {
    int result = i * j;
    return result;
  }

  @Override
  public int div(int i, int j) {
    int result = i / j;
    return result;
  }

}
